 
var API = {
    baseURL:"https://www.alyvip.cn",
    //https://houqin.xauat.edu.cn
    // baseURL:"", 
    uploadUrl:"/i/system/view.jsp?viewid=i_like_to_apply_for_repair_view&action=service&servicename=upload_image_video",
    /**
     * 获取用户登录信息
     */
    getUerInfo:function(success,error){
        if(ENV && ENV=="dev"){
            success(loginData1);
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"getlogindata"
        };
        this.GET(data,success,error);
    },

    /**
     *  获取维修界面参数
     */
    getRepairPageDict:function(success,error){
        debugger
        if(ENV && ENV=="dev"){
            success(mockData1);
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"getrepairinitdata"
        };
        this.GET(data,success,error);
    },
    /**
     * 获取报修工单列表
     * @param {传参} data 
     * @param {成功回调} success 
     */
    getRepairList:function(data,success){
        if(ENV && ENV=="dev"){
            //console.log("请求参数",data);
            //console.log("Mock数据",mockData2);
            success(mockData2);
            return;
        }
        data.viewid = "jiekou_my_seft_repair_workorder_view";
        data.action ="getDataForPageToShow";
        this.POST(data,success);
    },
    submitBaox:function(data,success){
        var url =API.baseURL +"/i/system/view.jsp";
        data.action = "service";
        data.servicename = "save_page_data";
        data.viewid = "i_like_to_apply_for_repair_view";
        this.POST(data,success,url);
    }, 

    /**
     * ------------------------------------获取公车预约订单--------------------------------------
     * @param {传参} data 
     * @param {成功函数} success 
     */
    getGcyyList:function(data,success){
        if(ENV && ENV=="dev"){
            //console.log("请求参数",data);
            //console.log("Mock数据",mockData3);
            success(mockData3);
            return;
        }
        data.viewid = "jiekou_my_seft_sp_car_service_buy_view";
        data.action ="getDataForPageToShow"; 
        this.POST(data,success);
    },
    /**
         *  获取公车预约界面参数
         */
    getGcyyPageDict:function(success,error){
        if(ENV && ENV=="dev"){
            success(mockData5);
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"getgongcheinitdata"
        };
        this.GET(data,success,error);
    },
    //提交公车预约
    submitGcyy:function(data,success){
        var url=API.baseURL +"/i/ph/car_apply.jsp";
        data.action = "save_page_data"; 
        this.POST(data,success,url);
    },

      /**
     * -----------------------------------获取家政服务订单------------------------------------
     * @param {传参} data 
     * @param {成功函数} success 
     */
    getJzfwList:function(data,success){
        if(ENV && ENV=="dev"){
            //console.log("请求参数",data);
            //console.log("Mock数据",mockData4);
            success(mockData4);
            return;
        }
        data.viewid = "jiekou_my_seft_os_order_jz_view";
        data.action ="getDataForPageToShow"; 
        this.POST(data,success);
    },
    //获取家政服务页面参数
    getJzfwPageDict:function(success,error){
        if(ENV && ENV=="dev"){
            success(mockData6);
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"getjiazhenginitdata"
        };
        this.GET(data,success,error);
    },
    //提交家政服务
    submitJzfw:function(data,success){
        data.action = "insert_order";
        var url =this.baseURL+"/i/ph/jiazheng_order_confirmation.jsp";
        this.POST(data,success,url);
    },


    //---获取点击次数------------------------------------------------------
    getClickTimes:function(servicenameinpange,success,error){
        if(ENV && ENV=="dev"){
            success(mockData7);
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"getservicetime",
            servicenameinpange
        };
        this.GET(data,success,error);
    },
    //获取点击次数+1
    addClickTimes:function(servicenameinpange){
        if(ENV && ENV=="dev"){ 
            //console.log("addTimes",servicenameinpange)
            return;
        }
        var data = {
            viewid:"jiekou_pc_get_data_view",
            action:"service",
            servicename:"addservicetime",
            servicenameinpange
        };
        this.GET(data);
    },
    GET:function(data,success,error){
        $.ajax({
            url:API.baseURL +"/i/system/view.jsp",
            type:"get",
            data,
            dataType:"json",
            success,
            error
        });
    },
    POST:function(data,success,url){
        data.this_jquery_post_ajax_time = new Date().getTime();
        data.isPostAjaxByJquery= true;
        data.isAjaxByJquery= true;
        //console.log("请求参数",data);
        var url_ = url?url:(API.baseURL+"/i/system/view.jsp");
        $.ajax({
            url:url_,
            type:"post",
            dataType:"json",
            data,
            success,
            error:function(data){
                console.error("error",data)
            } 
        });
    }


}

function show___(){
    var this_url = window.location.href; 
    console.log("电脑端-接入地址：");
    var url_pc="https://houqin.xauat.edu.cn/i/system/login_cas.jsp?url="+encodeURIComponent( this_url );
    console.log(url_pc);
}//show___
setTimeout(show___,200);  